extends "../cTDZ_2/cTDZ_2.gd"
func _info():
	pass
var cnt = 0
var sk1 = 0
func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "骷髅射手"
	lv = 2
	attCoe.atkRan = 3
	attCoe.atk = 23 / 8.5 * 2 / 2
	attCoe.maxHp = 610 / 112.5 / 2
	attAdd.spd = 1.5
	addSkillTxt("灵魂之箭：<固化>消耗自身3%生命上限，使下次普攻必定命中且附加1s眩晕[cd:3秒]")

func _onBattleStart():
	._onBattleStart()
	cnt = 0
	sk1 = 0

func _upS():
	._upS()
	cnt += 1
	if cnt == 3:
		cst("灵魂之箭","000000",position)
		cnt = 0
		lhzj()

func lhzj():
	sk1 = 1
	addBuff(LHZJ.new(1))

func _onAtkChara(atkinfo):
	._onAtkChara(atkinfo)
	if atkinfo.atkType == Chara.AtkType.NORMAL:
		var chas = atkinfo.hitCha.getCellChas(cell,1,2)
		#print(chas)
		if sk1:
			sk1 = 0
			atkinfo.isMiss = false
			if self.id != "cTDZ_2_3":
				for i in chas:
					i.addBuff(ctrl.b_xuanyun.new(0.5))

		if self.id != "cTDZ_2_3":
			if atkinfo.isMiss:return
			for i in chas:
				if i == atkinfo.hitCha:continue
				hurtChara(i,att.atk,Chara.HurtType.PHY,Chara.AtkType.EFF)

class LHZJ:
	extends Buff
	var canremove:bool = false
	func _init(lv):
		attInit()
		att.maxHpL = -0.03